#ifndef _BASEMODEL_H_
#define _BASEMODEL_H_

#include "common.h"

namespace nsModel
{
	enum eModelType
	{
		MODEL_TYPE_X_MESH = 0,
		MODEL_TYPE_PH_MESH,
		MODEL_TYPE_NONE
	};
}

#define EModelType	nsModel::eModelType

class CBaseModel
{
private:

	//////////////////////////////////////////////////////////////////////////
	// Generic Model Attributes
	string		m_szName;
	string		m_szPath;
	int			m_nNumVerts;
	int			m_nNumTris;
	EModelType	m_eType;
	
	//////////////////////////////////////////////////////////////////////////
	// Asset Attributes
	PhModelID	m_phAssetID;
	bool		m_bLoaded;
	int			m_nNameLength;

	CBaseModel(void);

public:

	virtual ~CBaseModel(void) = 0 {}
	CBaseModel(EModelType _eModelType);
	virtual bool Load(string _szModelName, IDirect3DDevice9* _pDev) = 0 {}
	virtual bool Unload(bool _bReloading = false);

	//////////////////////////////////////////////////////////////////////////
	// Accessors
	//////////////////////////////////////////////////////////////////////////
	inline const string GetName(void) { return m_szName; }
	inline const string GetPath(void) { return m_szPath; }
	inline const int GetNumVerts(void) { return m_nNumVerts; }
	inline const int GetNumTris(void) { return m_nNumTris; }
	inline const EModelType GetType(void) { return m_eType; }
	inline const PhModelID GetID(void) { return m_phAssetID; }
	inline const bool GetLoaded(void) { return m_bLoaded; }
	inline const int GetNameLength(void) { return m_nNameLength; }

	//////////////////////////////////////////////////////////////////////////
	// Modifiers
	//////////////////////////////////////////////////////////////////////////
	inline void SetName(string _szName) { m_szName = _szName; }
	inline void SetPath(string _szPath) { m_szPath = _szPath; }
	inline void SetNumVerts(int _nNumVerts) { m_nNumVerts = _nNumVerts; }
	inline void SetNumTris(int _nNumTris) { m_nNumTris = _nNumTris; }
	inline void SetType(EModelType _eType) { m_eType = _eType; }
	inline void SetID(PhModelID _phID) { m_phAssetID = _phID; }
	inline void SetLoaded(bool _bLoaded) { m_bLoaded = _bLoaded; }
	inline void SetNameLength(int _nLength) { m_nNameLength = _nLength; }
};

#endif